<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function checkAudio(){
				let myAudio = document.createElement('audio');
				if(myAudio.canPlayType){
					if('' != myAudio.canPlayType('audio/mpeg')){
						console.log('support mp3');
					}

					if('' != myAudio.canPlayType('audio/ogg;codecs="vorbis"')){
						console.log('support ogg');
					}

					if('' != myAudio.canPlayType('audio/mp4;codecs="mp4a.40.5"')){
						console.log('support AAC');
					}
				}else{
					console.log('not support audio check!');
				}
			}

			window.onload = function(){
				checkAudio();
			}

			function showInfo(){
				let myA = document.getElementById('audioControl');
				console.log('currentSrc', myA.currentSrc);
				console.log('currentTime', myA.currentTime);
				console.log('duration', myA.duration);
				console.log('ended', myA.ended);
				console.log('played', myA.played);
				console.log('paused', myA.paused);
				console.log('volume', myA.volume);
				console.log('seeking', myA.seeking);
			}

			function playOrPause(){
				let myA = document.getElementById('audioId');
				let myI = document.getElementById('btnId');

				if(myA.paused){
					myA.play();
					myI.value = 'pause';
				}else{
					myA.pause();
					myI.value = 'play';
				}
			}
		</script>
	</head>
	<body>
		<audio id="audioControl" controls="controls">
			<source src="audio/1.mp3" type="audio/mpeg" />
			<source src="audio/1.ogg" type="audio/ogg"/>
			你的浏览器不支持audio！
		</audio>
		<input type="button" onclick="showInfo()" value="show Info" />
		<!--<audio id="audioId">
			<source src="audio/1.mp3" type="audio/mpeg" />
			<source src="audio/1.ogg" type="audio/ogg"/>
			你的浏览器不支持audio！
		</audio>
		<input id="btnId" type="button" onclick="playOrPause()" value="control" />-->
	<div><script language="javascript">

	</script></div></body>
</html>
